package com.wh.system.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.system.pojo.EmployeeRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface EmployeeRoleDao extends BaseMapper<EmployeeRole> {

    List<EmployeeRole> findByPage(@Param("page") IPage<EmployeeRole> page, @Param("qw") QueryWrapper<EmployeeRole> queryWrapper);

    /**
     * 根据员工id查询对应的角色
     * @param empId  员工id
     * @return  拥有的角色们
     */
    List<Long>findRoleIdByEmployeeId(Long empId);


}
